//
// Created by 喵喵乐 on 2023/4/9.
//

#include "Cat.h"

void *Dog_1::operator new(size_t sz) {
    cout << "allocating a dog " << endl;
    throw 47;
}

void Dog_1::operator delete(void *p) {
    cout << "deallocating a Dog" << endl;
    ::operator delete(p);
}

UseResource::~UseResource() {
    cout << " ~ UseResource" << endl;
    delete[] bp;
    delete op;
}

UseResource::UseResource(int count) {
    cout << "Use Resources()" << endl;
    bp = new Cat[count];
    op = new Dog_1;

}


